package xiaolong.zhou.spring_demo.Service.achieve;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class RabbitSend {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 用户充值后邮箱信息发送至队列
     * @param queueName
     * @param data
     */
    public void RechargeQueues(String queueName, Map data)
    {
        if(queueName == "recharge-queues"){//队列名称
            rabbitTemplate.convertAndSend(queueName,"",data);//发送消息内容
        }
    }

}
